﻿using System;
using System.Data;
using Team4Mock.DAO;
namespace Team4Mock.Entity
{
    public class SupportEntity
    {
        SupportDAO s=new SupportDAO();
        private string uRL;
        private int supportid;
        private string description;
        private string supMatType;
        private string userID;
        private string addedDate;
        private int organizationID;
        private int active;
        public SupportEntity()
        { }
        public SupportEntity(string uRL, string description, string supMatType, string userID, string addedDate, int organizationID)
        {
            this.uRL = uRL;
            this.description = description;
            this.supMatType = supMatType;
            this.userID = userID;
            this.addedDate = addedDate;
            this.organizationID = organizationID;
        }

        public string URL
        {
            get { return this.uRL; }
            set
            {
                if (value == null)
                    throw new Exception("uRL not allow nullvalue.");
                this.uRL = value;
            }
        }
        public string Description
        {
            get { return this.description; }
            set { this.description = value; }
        }
        public string SupMatType
        {
            get { return this.supMatType; }
            set { this.supMatType = value; }
        }
        public string UserID
        {
            get { return this.userID; }
            set { this.userID = value; }
        }
        public int Supportid
        {
            get { return this.supportid; }
            set { this.supportid = value; }
        }
        public int IsActive
        {
            get { return this.active; }
            set { this.active = value; }
        }
        public string AddedDate
        {
            get { return this.addedDate; }
            set { this.addedDate = value; }
        }
        public int OrganizationID
        {
            get { return this.organizationID; }
            set { this.organizationID = value; }
        }
        public DataTable GetData(SupportEntity e)
        {
            return s.GetData(e.Supportid);
        }
        public DataTable GetDataById(SupportEntity e)
        {
            return s.GetDataByiD(e.OrganizationID);
        }
        public void Insert(SupportEntity e)
        {
            s.Insert(e.URL,e.Description,e.SupMatType,e.UserID,e.AddedDate,e.OrganizationID,e.IsActive);
        }
        public void Update(SupportEntity e)
        {
            s.Update(e.URL, e.Description, e.SupMatType, e.IsActive,e.Supportid);
        }
        public void Del(SupportEntity e)
        {
            s.Del(e.Supportid);
        }
    }
}